Leeds EPC / Property age Data Exploration

Imports:

Extract EPC data for Leeds only:

Read in EPC data for Leeds:

Drop unneccessary columns:

Grab ONS Postcode Lookup file (2020):

Read in the ONS Postcode Lookup file & drop unnecessary columns:

Merge the EPC data with the ONS postcode lookup (removing any entries with invalid postcodes):

Drop rows where the LSOA isn't in Leeds:

Sort by EPC date and remove outdated EPC's (ie. if a property has multiple EPC's)

Create a table to store output:

Calculate average current & potential EPC ratings by LSOA:

Standardise age band naming:

Get the number of properties in each age band by LSOA:

Calculate total number of properties and mode age band by LSOA:

Get VOA 2020 Housing Stock data to compare:

Filter to Leeds LSOA's only:

Drop unnecessary columns and standardise age band naming:

Convert column datatypes to numerical:

Calculate total properties and mode age band by LSOA:

Calculate percentage of total properties with a published EPC:

Sort by LSOA and save as CSV file:

Grab the LSOA 2011 Boundaries Shapefile from the ONS and filter to Leeds only:

Merge the LSOA boundaries table with our LSOA summary table to create a geographic summary:

Save as GeoJSON:

Load the saved GeoJSON and create some maps: